<template>
	<view class="container">
		<view class="button-group">
			<button class="btn btn-warehouse" @click="jumpRouter(1)">入库</button>
			<button class="btn btn-damage"  @click="jumpRouter(2)">定损</button>
		</view>
		<view>
			<uni-popup ref="alertDialog" type="dialog">
				<uni-popup-dialog type="info" cancelText="关闭" confirmText="同意" title="通知" content="是否退出当前账号"
					@confirm="dialogConfirm">
				</uni-popup-dialog>
			</uni-popup>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		onBackPress() {
			console.log('123')
			this.$refs.alertDialog.open()
			return true
		},
		methods: {
			jumpRouter (parma) {
				if(parma === 1) {
					uni.navigateTo({
					  url: '/pages/home/home'
					})
				} else {
					uni.navigateTo({
					  url: '/pages/lostModule/lostModule'
					})
				}
			},
			dialogConfirm () {
				 try {
					uni.removeStorageSync('token');
					uni.removeStorageSync('userInfo');
					this.$refs.alertDialog.close();
					uni.reLaunch({ url: '/pages/login/index/index' });
				} catch (e) {
					console.error('退出失败', e);
				}
			}
		}
	}
</script>

<style scoped>
	page {
	    height: 100%;
	    overflow: hidden;
	}
.container {
	display: flex;
	justify-content: center;
	align-items: center;
	height: 100vh;
	background-color: #f5f5f5;
}

.button-group {
	display: flex;
	flex-direction: column;
	gap: 40rpx;
	width: 80%;
	max-width: 500rpx;
}

.btn {
	padding: 24rpx 84rpx;
	border-radius: 50rpx;
	font-size: 32rpx;
	color: white;
	font-weight: bold;
	border: none;
	box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
	transition: all 0.3s ease;
}

.btn:active {
	transform: scale(0.98);
	box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.2);
}

.btn-warehouse {
	background: linear-gradient(135deg, #9ACD32, #7CB342);
}

.btn-damage {
	background: linear-gradient(135deg, #4169E1, #5C6BC0);
}
</style>